{% extends "admin/admin_base.html" %}

{% block content %}

<!--显示闪现的消息-->
{% with messages = get_flashed_messages() %}
{% if messages %}
<ur>
    {% for message in messages %}
    <div class="alert alert-success" style="text-align: center">
        <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
        <li>{{ message }}</li>
    </div>
    {% endfor %}
</ur>
{% endif %}
{% endwith %}

<div class="table-responsive">
    <table class="table table-condensed table-bordered">
        <caption>留言管理</caption>
        <tr>
            <th>评论</th>
            <th>评论者</th>
            <th>邮箱</th>
            <th>时间</th>
            <th>操作</th>
        </tr>
        <!-- 取出用户数据 -->
        {% for liuyan in liuyan_info %}
        <tr>
            <td style="display:table-cell; vertical-align:middle!important;">
                <a href="{{ url_for('liuyanban.liuyan') }}">{{ liuyan.body }}</a>
            </td>
            <td style="display:table-cell; vertical-align:middle!important;">{{ liuyan.username }}</td>
            <td style="display:table-cell; vertical-align:middle!important;">{{ liuyan.email }}</td>
            <td style="display:table-cell; vertical-align:middle!important;">{{ liuyan.send_time }}</td>
            <!-- 将文章id通过get方式传过去 -->
            <td>
                <a href="{{ url_for('liuyanban.edit_liuyan',liuyan_id=liuyan.id) }}" data-toggle="tooltip" data-placement="top" title=""
                   data-original-title="修改">
                    <i class="mdi mdi-24px mdi-pencil-circle"></i>
                </a>
                <a class="post-del" href="{{ url_for('liuyanban.liuyan_del',liuyan_id=liuyan.id) }}" data-toggle="tooltip"
                   data-placement="top" title=""
                   data-original-title="删除">
                    <i class="mdi mdi-24px mdi-delete-circle"></i>
                </a>
            </td>
        </tr>
        {% endfor %}
    </table>
    <!--分页-->
    {{pagination.links}}
</div>

{% endblock %}